package acm.蓝桥杯模拟;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

class Reader {
    private StringTokenizer in=new StringTokenizer("");
    private BufferedReader reader=new BufferedReader(new InputStreamReader(System.in));
    public String next(){
        hasNext();
        return in.nextToken();
    }
    public boolean hasNext(){
        if (!in.hasMoreTokens()) {
            String line = null;
            try {
                line = reader.readLine();
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
            if (line==null){
                return false;
            }
            in=new StringTokenizer(line);
        }
        return true;
    }
    public int nextInt(){
        return Integer.parseInt(next());
    }
    public String nextLine(){
        try {
            in=new StringTokenizer("");
            return reader.readLine();
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }
}
